<?php
	$id = $_GET["id"];
	$loi = "";
	if(isset($_POST["ok"])){
		$l = "";
		if($_POST["loai"] == null){
			$loi[] = "Chua nhap loai";
		}else{
			$l = $_POST["loai"];
		}
		if($l){
			$edit = new mloai();
			$edit->setloai($l);
			$edit->setid($id);
			$edit->edit();
			header("location: index.php?module=loai&action=list");
			exit();
		}
	}
	$show = new mloai();
	$show->setid($id);
	$data = $show->get();
	require ("views/loaixe/vedit_loai.php");
?>